Optimal. Leaf size=266 \[ -\frac {b \left (3 a^2 (2-n)+b^2 (1-n)\right ) \sin (e+f x) (d \cos (e+f x))^n \, _2F_1\left (\frac {1}{2},\frac {n}{2};\frac {n+2}{2};\cos ^2(e+f x)\right )}{f (2-n) n \sqrt {\sin ^2(e+f x)}}-\frac {a \left (a^2 (1-n)-3 b^2 n\right ) \sin (e+f x) \cos (e+f x) (d \cos (e+f x))^n \, _2F_1\left (\frac {1}{2},\frac {n+1}{2};\frac {n+3}{2};\cos ^2(e+f x)\right )}{f (1-n) (n+1) \sqrt {\sin ^2(e+f x)}}+\frac {a b^2 (5-2 n) \tan (e+f x) (d \cos (e+f x))^n}{f (1-n) (2-n)}+\frac {b^2 \tan (e+f x) (a+b \sec (e+f x)) (d \cos (e+f x))^n}{f (2-n)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.46, antiderivative size = 266, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 6, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.261, Rules used = {4264, 3842, 4047, 3772, 2643, 4046} \[ -\frac {b \left (3 a^2 (2-n)+b^2 (1-n)\right ) \sin (e+f x) (d \cos (e+f x))^n \, _2F_1\left (\frac {1}{2},\frac {n}{2};\frac {n+2}{2};\cos ^2(e+f x)\right )}{f (2-n) n \sqrt {\sin ^2(e+f x)}}-\frac {a \left (a^2 (1-n)-3 b^2 n\right ) \sin (e+f x) \cos (e+f x) (d \cos (e+f x))^n \, _2F_1\left (\frac {1}{2},\frac {n+1}{2};\frac {n+3}{2};\cos ^2(e+f x)\right )}{f (1-n) (n+1) \sqrt {\sin ^2(e+f x)}}+\frac {a b^2 (5-2 n) \tan (e+f x) (d \cos (e+f x))^n}{f (1-n) (2-n)}+\frac {b^2 \tan (e+f x) (a+b \sec (e+f x)) (d \cos (e+f x))^n}{f (2-n)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2643
Rule 3772
Rule 3842
Rule 4046
Rule 4047
Rule 4264
Rubi steps
\begin {align*} \int (d \cos (e+f x))^n (a+b \sec (e+f x))^3 \, dx &=\left ((d \cos (e+f x))^n (d \sec (e+f x))^n\right ) \int (d \sec (e+f x))^{-n} (a+b \sec (e+f x))^3 \, dx\\ &=\frac {b^2 (d \cos (e+f x))^n (a+b \sec (e+f x)) \tan (e+f x)}{f (2-n)}+\frac {\left ((d \cos (e+f x))^n (d \sec (e+f x))^n\right ) \int (d \sec (e+f x))^{-n} \left (a d \left (a^2 (2-n)-b^2 n\right )+b d \left (b^2 (1-n)+3 a^2 (2-n)\right ) \sec (e+f x)+a b^2 d (5-2 n) \sec ^2(e+f x)\right ) \, dx}{d (2-n)}\\ &=\frac {b^2 (d \cos (e+f x))^n (a+b \sec (e+f x)) \tan (e+f x)}{f (2-n)}+\frac {\left ((d \cos (e+f x))^n (d \sec (e+f x))^n\right ) \int (d \sec (e+f x))^{-n} \left (a d \left (a^2 (2-n)-b^2 n\right )+a b^2 d (5-2 n) \sec ^2(e+f x)\right ) \, dx}{d (2-n)}+\frac {\left (b \left (b^2 (1-n)+3 a^2 (2-n)\right ) (d \cos (e+f x))^n (d \sec (e+f x))^n\right ) \int (d \sec (e+f x))^{1-n} \, dx}{d (2-n)}\\ &=\frac {a b^2 (5-2 n) (d \cos (e+f x))^n \tan (e+f x)}{f (1-n) (2-n)}+\frac {b^2 (d \cos (e+f x))^n (a+b \sec (e+f x)) \tan (e+f x)}{f (2-n)}+\frac {\left (b \left (b^2 (1-n)+3 a^2 (2-n)\right ) \left (\frac {\cos (e+f x)}{d}\right )^{-n} (d \cos (e+f x))^n\right ) \int \left (\frac {\cos (e+f x)}{d}\right )^{-1+n} \, dx}{d (2-n)}+\frac {\left (a \left (a^2 (1-n)-3 b^2 n\right ) (d \cos (e+f x))^n (d \sec (e+f x))^n\right ) \int (d \sec (e+f x))^{-n} \, dx}{1-n}\\ &=-\frac {b \left (b^2 (1-n)+3 a^2 (2-n)\right ) (d \cos (e+f x))^n \, _2F_1\left (\frac {1}{2},\frac {n}{2};\frac {2+n}{2};\cos ^2(e+f x)\right ) \sin (e+f x)}{f (2-n) n \sqrt {\sin ^2(e+f x)}}+\frac {a b^2 (5-2 n) (d \cos (e+f x))^n \tan (e+f x)}{f (1-n) (2-n)}+\frac {b^2 (d \cos (e+f x))^n (a+b \sec (e+f x)) \tan (e+f x)}{f (2-n)}+\frac {\left (a \left (a^2 (1-n)-3 b^2 n\right ) \left (\frac {\cos (e+f x)}{d}\right )^{-n} (d \cos (e+f x))^n\right ) \int \left (\frac {\cos (e+f x)}{d}\right )^n \, dx}{1-n}\\ &=-\frac {b \left (b^2 (1-n)+3 a^2 (2-n)\right ) (d \cos (e+f x))^n \, _2F_1\left (\frac {1}{2},\frac {n}{2};\frac {2+n}{2};\cos ^2(e+f x)\right ) \sin (e+f x)}{f (2-n) n \sqrt {\sin ^2(e+f x)}}-\frac {a \left (a^2 (1-n)-3 b^2 n\right ) \cos (e+f x) (d \cos (e+f x))^n \, _2F_1\left (\frac {1}{2},\frac {1+n}{2};\frac {3+n}{2};\cos ^2(e+f x)\right ) \sin (e+f x)}{f (1-n) (1+n) \sqrt {\sin ^2(e+f x)}}+\frac {a b^2 (5-2 n) (d \cos (e+f x))^n \tan (e+f x)}{f (1-n) (2-n)}+\frac {b^2 (d \cos (e+f x))^n (a+b \sec (e+f x)) \tan (e+f x)}{f (2-n)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.75, size = 222, normalized size = 0.83 \[ -\frac {\sqrt {\sin ^2(e+f x)} \csc (e+f x) \sec ^2(e+f x) (d \cos (e+f x))^n \left (\frac {1}{2} a (n-2) \cos (e+f x) \left (2 a (n-1) \cos (e+f x) \left (a n \cos (e+f x) \, _2F_1\left (\frac {1}{2},\frac {n+1}{2};\frac {n+3}{2};\cos ^2(e+f x)\right )+3 b (n+1) \, _2F_1\left (\frac {1}{2},\frac {n}{2};\frac {n+2}{2};\cos ^2(e+f x)\right )\right )+6 b^2 n (n+1) \, _2F_1\left (\frac {1}{2},\frac {n-1}{2};\frac {n+1}{2};\cos ^2(e+f x)\right )\right )+b^3 n \left (n^2-1\right ) \, _2F_1\left (\frac {1}{2},\frac {n-2}{2};\frac {n}{2};\cos ^2(e+f x)\right )\right )}{f (n-2) (n-1) n (n+1)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [F] time = 0.45, size = 0, normalized size = 0.00 \[ {\rm integral}\left ({\left (b^{3} \sec \left (f x + e\right )^{3} + 3 \, a b^{2} \sec \left (f x + e\right )^{2} + 3 \, a^{2} b \sec \left (f x + e\right ) + a^{3}\right )} \left (d \cos \left (f x + e\right )\right )^{n}, x\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (b \sec \left (f x + e\right ) + a\right )}^{3} \left (d \cos \left (f x + e\right )\right )^{n}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [F] time = 11.27, size = 0, normalized size = 0.00 \[ \int \left (d \cos \left (f x +e \right )\right )^{n} \left (a +b \sec \left (f x +e \right )\right )^{3}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (b \sec \left (f x + e\right ) + a\right )}^{3} \left (d \cos \left (f x + e\right )\right )^{n}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.00 \[ \int {\left (d\,\cos \left (e+f\,x\right )\right )}^n\,{\left (a+\frac {b}{\cos \left (e+f\,x\right )}\right )}^3 \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (d \cos {\left (e + f x \right )}\right )^{n} \left (a + b \sec {\left (e + f x \right )}\right )^{3}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________